﻿/*
 * Subject：日志创建者
 * Date：2023/1
 * Context：日志创建者将创建/保存日志数据模型
 *  这里用到将模型序列为字符串（需安装Newtonsoft.Json包）
 * 
 * **/
using Newtonsoft.Json;

namespace Max.PH6_2006A.LowCode.API.LogHander
{
    public interface IRequestResponseLogModelCreator
    {
        RequestResponseLogModel LogModel { get; }
        string LogString();
    }
    public class RequestResponseLogModelCreator : IRequestResponseLogModelCreator
    {
        public RequestResponseLogModel LogModel { get; private set; }
        public RequestResponseLogModelCreator()
        {
            LogModel = new RequestResponseLogModel();
        }
        public string LogString()
        {
            var jsonString = JsonConvert.SerializeObject(LogModel);
            return jsonString;
        }
    }
}
